{include file="public/head"/}
<link rel="stylesheet" href="__PUBLIC__phone/css/login.css"/>
<body>
<div class="loginbg">
    <div class="loginWrap">
        <div class="formBg">
            <form class="form-horizontal">
                <div class="title">
                    <h4>云池物联管理平台</h4>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon glyphicon glyphicon-user"></span>
                        <input type="text" class="form-control" name="name" id="username" aria-describedby="inputGroupSuccess1Status" placeholder="用户名">
                    </div>
                    <!--提示-->
                    <p class="errorhint">输入的账号不正确</p>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon glyphicon glyphicon-lock"></span>
                        <input type="password" class="form-control" name="pass" id="password" aria-describedby="inputGroupSuccess1Status" placeholder="密码">
                    </div>
                    <!--提示-->
                    <p class="errorhint">密码不正确请重新输入</p>
                </div>
                <div class="form-group">
                    <div class="col-xs-7">
                        <div class="input-group">
                            <span class="input-group-addon glyphicon glyphicon-picture"></span>
                            <input type="text" class="form-control" name="code" id="yanzhengma" aria-describedby="inputGroupSuccess1Status" placeholder="验证码">
                        </div>
                    </div>
                    <div class="col-xs-5">
                        <img title="点击更换" src="{:captcha_src()}" onclick="this.src='{:captcha_src()}?rand='+Math.random()" class="yanzhengma"/>
                    </div>
                    <!--提示-->
                    <p class="errorhint">验证码不正确</p>
                </div>
                <div class="form-group text-center">
                    <!--<a href="{:url('/home/Quick/index')}" class="payqulik">快速续费</a>-->
                    <button type="button" class="btn subbtn">登陆</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){
        $('button:button').on('click',function(){
            var _form = $('.form-horizontal').serializeArray();
            for(var i in _form){
                if(!$.trim(_form[i]['value'])){
                    $('input[name="'+_form[i]['name']+'"]').parents('.form-group').find('.errorhint').show();
                    return false;
                }
            }
            $.post("{:url('/home/Login/checkLogin')}",_form,function(data){
                if(data.code != '0'){
                    // 刷新验证码
                    $('img.yanzhengma').click();
                    $('input[name="'+data.param+'"]').parents('.form-group').find('.errorhint').text(data.msg).show();
                } else {
                    window.location.href = "{:url('/home/Index/index')}";
                }
            })
        })
    })
</script>
</html>